package com.lc.oss.controller;

import com.lc.oss.utils.OssUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @description: some desc
 * @author: LChuang
 * @date: 2023/11/30 17:35
 */
@RestController
@RequestMapping("/oss")
public class OssController {

    @Resource
    private OssUtil ossUtil;

    @PostMapping("/qiNiu/upload")
    public String qiNiuUpload(@RequestParam("file") MultipartFile file){
        String url = ossUtil.qiNiuUpLoad(file);
        return url;
    }

    @PostMapping("/aliyun/upload")
    public String aliyunUpload(@RequestParam("file") MultipartFile file){
        String url = ossUtil.aliyunUpload(file);
        return url;
    }
}
